Updating the ConversationsMessageAddHandler to have optional attachments #121
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
For the purposes of a demo video that utilizes Slack MCP and Cartesia MCP, I needed to be able to attach files to messages through MCP, so I made the following changes:
Slack API
MCP
addMessageParamsto include a potentialattachmentURLandattachmentNameattachmentURLcan be a local file or publicly accessible file URL. The file at this URL will be downloaded in and used as the body for the file upload APIattachmentNamethe name to use for the uploaded fileConversationsAddMessageHandlerto incorporate a file attachment pathattachment_urlis specified, we interpret local vs remote files , download, and then call the Slack API for uploading files (with an optional initial comment + thread timestamp)attachment_urlis specified, the previous behavior of calling the Slack API to post a message works as it did beforeTesting
The tweet linked above exhibits the functionality in action.
make buildto build the binary--transport stdioarguments and the relevant Slack tokens